﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Order_Print.aspx.cs" Inherits="shop_Order_Print" %>

<%@ Import Namespace="System.Data" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>销售单</title>
    <link href="../style/main.css" rel="stylesheet" type="text/css" />

    <script type="text/jscript">
     function ponload() 
     { 
        window.focus(); 
        window.print(); 
        setTimeout("window.close()", 100);
     }
    </script>

</head>
<body onload="ponload()">
    <form id="form1" runat="server">
    <div>
        <div style="text-align: left">
            
            <table style="width: 800px">
                <tr>
                    <td colspan="5" style="text-align: center; height: 21px;">
                        <strong>
                            <asp:Label ID="lbShopName" runat="server" Width="110px"></asp:Label>
                            公司销售单 
                            <asp:Label ID="lbShopUrl" runat="server" Text=""></asp:Label></strong>
                    </td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: left; height: 21px;">
                        消费者姓名：
                    </td>
                    <td style="height: 21px">
                        <asp:Label ID="lbCustomerNO" runat="server" Width="150px"></asp:Label>
                    </td>
                    <td style="width: 340px; height: 21px;">
                    </td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: left; height: 21px;">
                        收货地址：
                    </td>
                    <td style="height: 21px">
                        <asp:Label ID="lbConsigneeAdress" runat="server" Width="150px"></asp:Label>
                    </td>
                    <td style="width: 340px; height: 21px;">
                    </td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: left; height: 21px;">
                        消费者联系电话：
                    </td>
                    <td style="height: 21px">
                        <asp:Label ID="lbConsigneeTel" runat="server" Width="150px"></asp:Label>
                    </td>
                    <td style="width: 340px; height: 21px;">
                    </td>
                </tr>
                <tr>
                    <td colspan="5" style="height: 85px">
                        <br />
                        <table border="0" cellpadding="0" cellspacing="1" bgcolor="#6CA4E4" style="width: 800px;
                            text-align: center; height: 140px;" id="TABLE1" onclick="return TABLE1_onclick()">
                            <tr style="background-image: url(../Images/bg_index.jpg)">
                                <td style="width: 140px; height: 21px;">
                                    产品名称
                                </td>
                                <td style="width: 89px; height: 21px;">
                                    产品编号
                                </td>
                                <td style="width: 83px; height: 21px;">
                                    订单编号
                                </td>
                                <td style="width: 100px; height: 21px;">
                                    产品单价
                                </td>
                                <td style="width: 100px; height: 21px;">
                                    产品数量
                                </td>
                                <td style="width: 100px; height: 21px;">
                                    金 额
                                </td>
                            </tr>
                            <%                                             
                              double money = 0;
                             
                              for (int i = 0, j = 0; i < dt.Rows.Count; i++, j++)
                              {                                     
                                double price = double.Parse(dt.Rows[i]["Price_Vip"].ToString());
                                double amount=double.Parse(dt.Rows[i]["Amount"].ToString());
                                money += price * amount;
                            %>
                            <tr>
                                <td bgcolor="#FFFFFF" style="width: 140px; height: 21px;">
                                    <%=dt.Rows[i]["GoodName_CN"].ToString()%>
                                </td>
                                <td bgcolor="#FFFFFF" style="width: 89px; height: 21px;">
                                    <%=dt.Rows[i]["GoodNo"].ToString()%>
                                </td>
                                <td bgcolor="#FFFFFF" style="width: 83px; height: 21px;">
                                    <%=OrderNo %>
                                </td>
                                <td bgcolor="#FFFFFF" style="width: 100px; height: 21px;">
                                    <%=dt.Rows[i]["Price_Vip"].ToString()%>
                                </td>
                                <td bgcolor="#FFFFFF" style="width: 100px; height: 21px;">
                                    <%=dt.Rows[i]["Amount"].ToString()%>
                                </td>
                                <td bgcolor="#FFFFFF" style="width: 100px; height: 21px;">
                                    <%=dt.Rows[i]["ActualPrice"].ToString()%>
                                </td>
                            </tr>
                              <%
                                        if(j<4&&i==dt.Rows.Count-1)
                                          {
                                              for (; j < 4; j++)
                                              {
                                                  %>
                                           <tr>
                                                        <td bgcolor="#FFFFFF" style="width: 100px">-</td>
                                                        <td bgcolor="#FFFFFF" style="width: 140px">- </td>
                                                        <td bgcolor="#FFFFFF" style="width: 89px"> -</td>
                                                        <td bgcolor="#FFFFFF" style="width: 83px"> -</td>
                                                        <td bgcolor="#FFFFFF" style="width: 100px">-</td>
                                                        <td bgcolor="#FFFFFF" style="width: 100px">-</td>                                                      
                                          </tr> 
                                                  <% 
                                              }
                                          }
                                    %>
                                   <%if (j == 4)
                                           {
                                                j = -1;
                                                    
                                   %>                        
                                               
                            
                            <tr>
                                <td bgcolor="#FFFFFF" style="text-align: right;" colspan="6">
                                    <asp:Label ID="lbShopName2" runat="server" Text=""></asp:Label>
                                公司销售单（凭此单享受售后三包服务）
                            </tr>
                            <tr>
                                <td bgcolor="#FFFFFF" style="text-align: right;" colspan="5">
                                   打单日期：<%=CreateDate %>
                                </td>
                                <td bgcolor="#FFFFFF" style="text-align: right;" >
                                   流水号： <asp:Label ID="Label3" runat="server" Text="N19000"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td bgcolor="#FFFFFF" style="text-align: right;" colspan="6">                                    
                                 消费者联
                            </tr>
                        </table>
                                              <%
                                                } 
                                            %>

                     <%} %>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <input id="hID" runat="server" type="hidden" />
    </form>
</body>
</html>
